1 00:00:00,370 --> 00:00:02,800 Welcome back in this section of the course. 2 00:00:02,800 --> 00:00:07,390 We're now going to take all the information we've learned in the previous two sections and apply it 3 00:00:07,390 --> 00:00:08,320 in our scripts. 4 00:00:08,320 --> 00:00:09,220 For this project. 5 00:00:09,220 --> 00:00:13,360 We're going to create an SCP from the SCP wiki, if you've ever heard of that. 6 00:00:13,360 --> 00:00:19,030 If not, the SCP wiki is a fun little wiki that tells you about the story of a fictional organization 7 00:00:19,030 --> 00:00:25,300 called the SCP Foundation, and this organization specializes in researching and containing anomalous 8 00:00:25,300 --> 00:00:27,670 objects and entities found on Earth. 9 00:00:27,670 --> 00:00:33,880 These objects can do things like emit strange types of radiation or decay materials around them, cause 10 00:00:33,880 --> 00:00:36,490 mental problems, hallucinations, and so on. 11 00:00:36,490 --> 00:00:40,510 Some scp's can be safe, while other shops could destroy the entire world. 12 00:00:40,510 --> 00:00:43,540 The whole point of an SCP is that it is anomalous. 13 00:00:43,900 --> 00:00:49,960 Now, SCP 294 is described as a drink vending machine that dispenses a drink of whatever you describe 14 00:00:49,960 --> 00:00:50,320 to it. 15 00:00:50,320 --> 00:00:56,290 You can enter in water and get a cup of water, or you could enter in lava and get a cup of lava. 16 00:00:56,290 --> 00:01:01,960 You can also enter in more abstract concepts like pain and it'll dispense to you a cup of paint. 17 00:01:01,960 --> 00:01:08,650 It's a pretty neat SCP that we can replicate in Roblox studio, so I'll demonstrate SCP 294 right here. 18 00:01:08,920 --> 00:01:13,360 We can interact with it and get this guy on our screen, and we can go ahead and enter a drink that 19 00:01:13,360 --> 00:01:13,930 we like. 20 00:01:13,930 --> 00:01:16,900 So if I'd like a cup of water, I can enter in water. 21 00:01:19,210 --> 00:01:21,310 And it'll dispense me a cup of water. 22 00:01:22,810 --> 00:01:25,420 And then I get my nice cup of water and I can drink it. 23 00:01:25,420 --> 00:01:26,290 And there we go. 24 00:01:26,290 --> 00:01:28,630 We have a simple, refreshing cup of water. 25 00:01:28,630 --> 00:01:32,230 And I can also enter in some more abstract concepts, like a cup of pain. 26 00:01:32,230 --> 00:01:35,170 So I could type in pain and dispense that out. 27 00:01:43,420 --> 00:01:48,130 And here I have my cup of pain and if I drink it, I can have some cool effect happen to me. 28 00:01:52,700 --> 00:01:56,960 So let's go ahead and get started creating this in Roblox studio. 29 00:01:57,140 --> 00:01:57,470 All right. 30 00:01:57,470 --> 00:02:02,330 So for us to get started creating this SCP using an object oriented programming, there's a little bit 31 00:02:02,330 --> 00:02:03,890 of setup we need to complete. 32 00:02:03,920 --> 00:02:08,750 Now I've attached this model to the lecture which contains all the assets you'll need for this project. 33 00:02:08,750 --> 00:02:12,020 So you'll want to go ahead and grab it and insert it into your game. 34 00:02:12,020 --> 00:02:16,910 With our model we're going to go ahead and take some of these assets and place them inside of some different 35 00:02:16,910 --> 00:02:18,110 services in our game. 36 00:02:18,110 --> 00:02:24,500 So first off this SCP 294 assets folder is going to be placed in replicated storage, and it houses 37 00:02:24,500 --> 00:02:30,650 some remote functions for us as well as a remote event as well as a module script that is going to act 38 00:02:30,650 --> 00:02:33,650 as a class for all of our drink objects. 39 00:02:33,650 --> 00:02:38,750 And here I also have the tool for our drink as well, and some other module scripts that will contain 40 00:02:38,750 --> 00:02:45,560 some pre-made drinks for our drink machine, as well as some neat effects for particular kinds of drinks. 41 00:02:46,190 --> 00:02:50,150 So let's go ahead and drag this and place it inside of a replicated storage. 42 00:02:50,150 --> 00:02:57,050 And then the next folder here, SCP 294 sounds is going to contain all the sounds we'll need for our 43 00:02:57,050 --> 00:03:02,090 machine, such as clicking buttons, the different dispense sounds, as well as the different drinking 44 00:03:02,090 --> 00:03:03,650 sounds for our cup. 45 00:03:03,650 --> 00:03:08,420 Currently, all of these don't have a sound ID applied to them, and that's because they're going to 46 00:03:08,420 --> 00:03:12,050 have to upload your own sounds in order to replace the sound IDs. 47 00:03:12,050 --> 00:03:16,730 Due to a audio update that Roblox pass where we can't share audio IDs anymore. 48 00:03:16,730 --> 00:03:23,390 So I'm going to also attach a bunch of audio files that you can use and upload to put into each of these 49 00:03:23,390 --> 00:03:24,290 audio files. 50 00:03:24,290 --> 00:03:29,330 You won't have to do it for the button, uh, the heartbeat or the punch sound effect, because I already 51 00:03:29,330 --> 00:03:30,410 found those for free. 52 00:03:30,410 --> 00:03:35,540 But otherwise you're going to have to upload your own sound IDs for the sound instances. 53 00:03:35,540 --> 00:03:40,400 And you also need to note that your Roblox account will have an audio upload limit. 54 00:03:40,400 --> 00:03:46,250 Unless you've, uh, ID verified your account, your upload limit can be increased to 100, but I think 55 00:03:46,250 --> 00:03:47,510 the default is ten. 56 00:03:47,510 --> 00:03:51,740 So again, you want to be a little bit careful with how many audio files you're uploading. 57 00:03:51,920 --> 00:03:57,800 Otherwise we can take this folder and place it inside of our sound service. 58 00:03:59,180 --> 00:04:03,380 So again, I'm going to have all those audio files attached to the lecture. 59 00:04:03,380 --> 00:04:08,270 Make sure you upload them to Roblox and put their IDs to their respective sound instances. 60 00:04:08,270 --> 00:04:12,050 Here the script is going to act as our initializer. 61 00:04:12,050 --> 00:04:17,270 It's just going to run the module scripts and make sure everything gets set up and initialized for our 62 00:04:17,270 --> 00:04:21,710 SCP when the server starts, and we can just place this inside of server script service. 63 00:04:22,630 --> 00:04:25,540 And then we're going to have A294 guy. 64 00:04:25,570 --> 00:04:27,070 This is going to be for the client. 65 00:04:27,070 --> 00:04:31,210 And again it's going to contain that guy for our SCP. 66 00:04:31,210 --> 00:04:36,820 And it's also going to contain the functionality for like drinking the drinks from the machine, displaying 67 00:04:36,820 --> 00:04:40,090 that text on the bottom of the screen and that kind of fun stuff. 68 00:04:40,090 --> 00:04:44,530 And we're going to go ahead and place this inside of our starter GUI service. 69 00:04:45,740 --> 00:04:48,950 Last things we have in here is going to be the SCP itself. 70 00:04:48,950 --> 00:04:50,180 This is just the model. 71 00:04:50,180 --> 00:04:53,570 And inside of this model just has an attachment and a proximity prompt. 72 00:04:53,570 --> 00:04:59,390 And the way we're going to set this up allows us to duplicate as many of these SCP objects as we like, 73 00:04:59,390 --> 00:05:02,060 so we can have multiple of these drink machines in our game. 74 00:05:02,060 --> 00:05:06,680 And in order for our game to collect each of the drink machines and connect a function to the proximity 75 00:05:06,680 --> 00:05:13,250 prompt, we're going to make sure that this SCP object or this part here, this mesh part has a tag 76 00:05:13,250 --> 00:05:14,180 attached to it. 77 00:05:14,180 --> 00:05:18,740 Now you should be familiar with the collection service, but if you aren't, then what the collection 78 00:05:18,740 --> 00:05:24,500 service does is that we can attach tags to different things in our game, different instances, and 79 00:05:24,500 --> 00:05:29,210 then using the collection service, we can get all the instances in our game that have a particular 80 00:05:29,210 --> 00:05:29,780 tag. 81 00:05:29,780 --> 00:05:34,520 So I also have a plug in attached to the lecture for creating new tags. 82 00:05:34,520 --> 00:05:37,910 And when you install this plugin, you'll be able to open up a tag window. 83 00:05:37,910 --> 00:05:42,710 And in here you can create new tags and see all the tags you already have in your game. 84 00:05:42,710 --> 00:05:47,990 And this SCP part should have the tag SCP 294 attached to it. 85 00:05:47,990 --> 00:05:52,010 So this is how we're going to be able to collect all of our SCP objects. 86 00:05:52,010 --> 00:05:58,880 So make sure you create a new tag named SCP 294 if that tag doesn't already exist, and make sure you 87 00:05:58,880 --> 00:06:01,430 add this part to that tag. 88 00:06:01,550 --> 00:06:07,850 The last thing we have here is our drink animation rig, and this houses some animations for our drink 89 00:06:07,850 --> 00:06:08,210 cup. 90 00:06:08,210 --> 00:06:10,250 So we're going to have two animations. 91 00:06:10,250 --> 00:06:15,950 One is going to be for drinking our drink cup, and the other animation is just going to be for holding 92 00:06:15,950 --> 00:06:17,000 out our drink cup. 93 00:06:17,000 --> 00:06:21,920 And because we can't share animations between different players accounts, you're going to have to open 94 00:06:21,920 --> 00:06:28,760 up the animation editor underneath the avatar tab, select this animation rig, and you'll be able to 95 00:06:28,760 --> 00:06:33,680 load the different animations that I've put in here, which is one for consuming and idling. 96 00:06:33,680 --> 00:06:36,140 So you want to go to each one of these animations. 97 00:06:36,140 --> 00:06:37,520 The first one is idle. 98 00:06:37,520 --> 00:06:42,860 You're going to want to make sure that this idle animation is looped, and the animation priority is 99 00:06:42,860 --> 00:06:43,790 set to movement. 100 00:06:43,790 --> 00:06:45,830 It should be automatically set to that already. 101 00:06:45,830 --> 00:06:52,040 And once you've verified that all of that is good, then we can publish it to Roblox and give it a name 102 00:06:52,040 --> 00:06:52,700 and whatnot. 103 00:06:52,700 --> 00:06:54,590 I believe I already have it uploaded. 104 00:06:54,590 --> 00:06:55,550 Yep, here we are. 105 00:06:55,550 --> 00:07:01,580 I'm just going to overwrite my original one, and once you do that, it should give you an ID here and 106 00:07:01,580 --> 00:07:09,590 you can copy that ID and once you've copied that ID, we can go back to our SCP 294 assets. 107 00:07:09,590 --> 00:07:11,870 And then we can go to our drink cup. 108 00:07:11,870 --> 00:07:17,300 And inside the drink cup I have a folder called animations, one for the consume animation and one for 109 00:07:17,300 --> 00:07:18,380 the idle animation. 110 00:07:18,380 --> 00:07:22,010 And you want to go ahead and paste your ID inside of there. 111 00:07:22,010 --> 00:07:27,740 So again you're going to upload these animations on your account and copy the IDs inside of these animation 112 00:07:27,740 --> 00:07:28,490 instances. 113 00:07:28,490 --> 00:07:31,550 So let's also do the same for the consume animation. 114 00:07:31,550 --> 00:07:32,600 We're going to load it. 115 00:07:32,780 --> 00:07:38,720 Make sure this one isn't looping and make sure the animation priority is set to action. 116 00:07:38,720 --> 00:07:41,090 And then again you can publish it to Roblox. 117 00:07:41,090 --> 00:07:42,110 Give it a name. 118 00:07:42,110 --> 00:07:45,320 I've already uploaded it, so I'm just going to write my original one. 119 00:07:46,070 --> 00:07:48,980 Hit submit and you'll get an ID here. 120 00:07:48,980 --> 00:07:49,640 Copy that. 121 00:07:49,640 --> 00:07:52,610 ID close that out and then we can put that. 122 00:07:52,640 --> 00:07:57,260 ID within our consume animation instance. 123 00:07:57,260 --> 00:08:00,710 So we'll just paste that ID in there and we're good to go. 124 00:08:00,740 --> 00:08:01,430 All right. 125 00:08:01,430 --> 00:08:03,080 So that's all the setup completed. 126 00:08:03,080 --> 00:08:06,530 And in the next lecture we're going to get started scripting our SCP. 127 00:08:06,530 --> 00:08:07,880 So see you there.